<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Construct a Swoole Channel</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.swoole-channel.html">« Swoole\Channel</a></li>
      <li style="float: right;"><a href="swoole-channel.destruct.html">Swoole\Channel::__destruct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.swoole-channel.html">Swoole\Channel</a></li>
    <li>Construct a Swoole Channel</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="swoole-channel.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Swoole\Channel::__construct</h1>
  <p class="verinfo">(PECL swoole &gt;= 1.9.0)</p><p class="refpurpose"><span class="refname">Swoole\Channel::__construct</span> &mdash; <span class="dc-title">Construct a Swoole Channel</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-swoole-channel.construct-description">
  <h3 class="title">说明</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Swoole\Channel::__construct</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$size</code></span>)</div>

  <p class="para rdfs-comment">
    Swoole channel is memory data structure works like Chan in Golang, implemented based on 
    shared memory and mutex locks. It can be used as high performance message queue in memory.
    Construct a swoole channel with a fixed size. The minimum size of a swoole channel is 64KB.
    Exceptions will be thrown if there is not enough memory.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-swoole-channel.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">size</code></dt>

    <dd>

     <p class="para">
      The size of the Swoole channel.
     </p>
    </dd>

   
  </dl>

 </div>


</div></div></div></body></html>